<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var now=new Date();
			var arr=[1,2,3,4,5];
			var obj={"name":"赵浩楠","age":23};
			var reg=/^$/;
			
			//方法1：
//			console.log(Array.prototype.isPrototypeOf(arr));
//			console.log(Array.prototype.isPrototypeOf(now));
//			console.log(Array.prototype.isPrototypeOf(obj));
//			console.log(Array.prototype.isPrototypeOf(reg));
			
			//方法2：
//			console.log(arr instanceof Array);
//			console.log(now instanceof Array);
//			console.log(obj instanceof Array);
//			console.log(reg instanceof Array);

			//方法3：
//			if(Array.isArray===undefined){
//				Array.isArray=function(x){
//					return x instanceof Array;
//				}
//			}
//		
//			console.log(Array.isArray(now));
//			console.log(Array.isArray(obj));
//			console.log(Array.isArray(reg));
//			console.log(Array.isArray(arr));

			//方法4：
			if(Object.prototype.toString.apply(arr)==="[object Array]"){
				console.log("true");
			}
			
			console.log(Object.prototype.toString.apply(arr));
			console.log(Object.prototype.toString.apply(now));
			console.log(Object.prototype.toString.apply(reg));
			console.log(Object.prototype.toString.apply(obj));
		</script>
		
		
	</body>
</html>
